<!-- include tpl=head_lay -->
<script type="text/javascript">
function save(obj)
{
	$(obj).ajaxSubmit({
		'url':get_url('all','tpl_setting_save'),
		'type':'post',
		'dataType':'json',
		'success':function(rs){
			if(rs.status){
				$.dialog.tips('自定义模板设置成功').lock();
				return true;
			}
			$.dialog.tips(rs.info);
			return false;
		}
	});
	return false;
}
</script>
<form method="post" id="post_save" onsubmit="return save(this)">
<div class="layui-card">
	<div class="layui-card-body">
		<table class="layui-table">
		<thead>
		<tr>
			<th>名称</th>
			<th>默认模板</th>
			<th>自定义模板</th>
		</tr>
		</thead>
		<!-- loop from=$tpls key=$key value=$value id=$tmpid -->
		<tr>
			<td><!-- if $value.title -->{$value.title}<!-- else -->{$value.default}<!-- /if --></td>
			<td>{$value.default}<!-- if $tplext -->.{$tplext}<!-- /if --></td>
			<td>
				<select name="{$key}">
					<option value="">{lang使用默认模板…}</option>
					<!-- loop from=$filelist key=$k value=$v id=$idx -->
					<option value="{$v.id}"{if $value.tpl && $v.id == $value.tpl} selected{/if}>{$v.title}</option>
					<!-- /loop -->
				</select>
			</td>
		</tr>
		<!-- /loop -->
		</table>
	</div>
</div>
<div class="submit-info-clear"></div>
<div class="submit-info">
	<div class="layui-container center">
		<input type="submit" value="{lang保存配置}" class="layui-btn layui-btn-lg layui-btn-danger" />
		<input type="button" value="{lang初始化配置}" class="layui-btn layui-btn-lg" onclick="$.admin_all.resetting()" />
		<input type="button" value="{lang取消关闭}" class="layui-btn layui-btn-lg layui-btn-primary" onclick="$.admin.close()" />
	</div>
</div>
</form>

<!-- include tpl=foot_lay -->